import { createApp } from 'vue'
import { createPinia } from 'pinia' // 1. 导入 createPinia
// import Casdoor from 'casdoor-vue-sdk';
import App from './App.vue'

// import './static/js/h5player.min.js'

// 导入所有组件
import UniBadge from '@dcloudio/uni-ui/lib/uni-badge/uni-badge.vue';
import UniCalendar from '@dcloudio/uni-ui/lib/uni-calendar/uni-calendar.vue';
import UniCard from '@dcloudio/uni-ui/lib/uni-card/uni-card.vue';
import UniCollapse from '@dcloudio/uni-ui/lib/uni-collapse/uni-collapse.vue';
import UniCollapseItem from '@dcloudio/uni-ui/lib/uni-collapse-item/uni-collapse-item.vue';
import UniCombox from '@dcloudio/uni-ui/lib/uni-combox/uni-combox.vue';
import UniCountdown from '@dcloudio/uni-ui/lib/uni-countdown/uni-countdown.vue';
import UniDataCheckbox from '@dcloudio/uni-ui/lib/uni-data-checkbox/uni-data-checkbox.vue';
import UniDataPicker from '@dcloudio/uni-ui/lib/uni-data-picker/uni-data-picker.vue';
import UniDataSelect from '@dcloudio/uni-ui/lib/uni-data-select/uni-data-select.vue';
import UniDateformat from '@dcloudio/uni-ui/lib/uni-dateformat/uni-dateformat.vue';
import UniDatetimePicker from '@dcloudio/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.vue';
import UniDrawer from '@dcloudio/uni-ui/lib/uni-drawer/uni-drawer.vue';
import UniEasyinput from '@dcloudio/uni-ui/lib/uni-easyinput/uni-easyinput.vue';
import UniFab from '@dcloudio/uni-ui/lib/uni-fab/uni-fab.vue';
import UniFav from '@dcloudio/uni-ui/lib/uni-fav/uni-fav.vue';
import UniFilePicker from '@dcloudio/uni-ui/lib/uni-file-picker/uni-file-picker.vue';
import UniForms from '@dcloudio/uni-ui/lib/uni-forms/uni-forms.vue';
import UniFormsItem from '@dcloudio/uni-ui/lib/uni-forms-item/uni-forms-item.vue';
import UniGoodsNav from '@dcloudio/uni-ui/lib/uni-goods-nav/uni-goods-nav.vue';
import UniGrid from '@dcloudio/uni-ui/lib/uni-grid/uni-grid.vue';
import UniGridItem from '@dcloudio/uni-ui/lib/uni-grid-item/uni-grid-item.vue';
import UniGroup from '@dcloudio/uni-ui/lib/uni-group/uni-group.vue';
import UniIcons from '@dcloudio/uni-ui/lib/uni-icons/uni-icons.vue';
import UniIndexedList from '@dcloudio/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue';
import UniLink from '@dcloudio/uni-ui/lib/uni-link/uni-link.vue';
import UniList from '@dcloudio/uni-ui/lib/uni-list/uni-list.vue';
import UniListItem from '@dcloudio/uni-ui/lib/uni-list-item/uni-list-item.vue';
import UniLoadMore from '@dcloudio/uni-ui/lib/uni-load-more/uni-load-more.vue';
import UniNavBar from '@dcloudio/uni-ui/lib/uni-nav-bar/uni-nav-bar.vue';
import UniNoticeBar from '@dcloudio/uni-ui/lib/uni-notice-bar/uni-notice-bar.vue';
import UniNumberBox from '@dcloudio/uni-ui/lib/uni-number-box/uni-number-box.vue';
import UniPagination from '@dcloudio/uni-ui/lib/uni-pagination/uni-pagination.vue';
import UniPopup from '@dcloudio/uni-ui/lib/uni-popup/uni-popup.vue';
import UniPopupDialog from '@dcloudio/uni-ui/lib/uni-popup-dialog/uni-popup-dialog.vue';
import UniPopupMessage from '@dcloudio/uni-ui/lib/uni-popup-message/uni-popup-message.vue';
import UniPopupShare from '@dcloudio/uni-ui/lib/uni-popup-share/uni-popup-share.vue';
import UniRate from '@dcloudio/uni-ui/lib/uni-rate/uni-rate.vue';
import UniSearchBar from '@dcloudio/uni-ui/lib/uni-search-bar/uni-search-bar.vue';
import UniSection from '@dcloudio/uni-ui/lib/uni-section/uni-section.vue';
import UniSegmentedControl from '@dcloudio/uni-ui/lib/uni-segmented-control/uni-segmented-control.vue';
import UniSteps from '@dcloudio/uni-ui/lib/uni-steps/uni-steps.vue';
import UniSwipeAction from '@dcloudio/uni-ui/lib/uni-swipe-action/uni-swipe-action.vue';
import UniSwipeActionItem from '@dcloudio/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue';
import UniSwiperDot from '@dcloudio/uni-ui/lib/uni-swiper-dot/uni-swiper-dot.vue';
import UniTable from '@dcloudio/uni-ui/lib/uni-table/uni-table.vue';
import UniTag from '@dcloudio/uni-ui/lib/uni-tag/uni-tag.vue';
import UniTransition from '@dcloudio/uni-ui/lib/uni-transition/uni-transition.vue';

import GlobalBG from '@/components/GlobalBG.vue';
import SelectPopup from '@/components/SelectPopup.vue';
import CustomTabbar from '@/components/CustomTabbar.vue';
// import { registerUniUI } from './utils/registerUniUI';
// import uni from '@dcloudio/uni-app'
// 2. 创建 Pinia 实例
const pinia = createPinia()
// const config = {
//   serverUrl: "http://111.33.84.118:8001",
//   clientId: "014c61932ae04112a313",
//   // serverUrl: import.meta.env.VITE_CASE_DOOR,
//   // clientId: import.meta.env.VITE_CLINTID,
//   appName: 'server_usermanage',
//   redirectPath: '/#/pages/login/index',
// };

// 3. 创建 Vue 应用
const app = createApp(App)
// app.use(Casdoor, config);
// 注册自定义导航
app.component('CustomTabbar', CustomTabbar);

// 注册所有组件
app.component('uni-badge', UniBadge);
app.component('uni-calendar', UniCalendar);
app.component('uni-card', UniCard);
app.component('uni-collapse', UniCollapse);
app.component('uni-collapse-item', UniCollapseItem);
app.component('uni-combox', UniCombox);
app.component('uni-countdown', UniCountdown);
app.component('uni-data-checkbox', UniDataCheckbox);
app.component('uni-data-picker', UniDataPicker);
app.component('uni-data-select', UniDataSelect);
app.component('uni-dateformat', UniDateformat);
app.component('uni-datetime-picker', UniDatetimePicker);
app.component('uni-drawer', UniDrawer);
app.component('uni-easyinput', UniEasyinput);
app.component('uni-fab', UniFab);
app.component('uni-fav', UniFav);
app.component('uni-file-picker', UniFilePicker);
app.component('uni-forms', UniForms);
app.component('uni-forms-item', UniFormsItem);
app.component('uni-goods-nav', UniGoodsNav);
app.component('uni-grid', UniGrid);
app.component('uni-grid-item', UniGridItem);
app.component('uni-group', UniGroup);
app.component('uni-icons', UniIcons);
app.component('uni-indexed-list', UniIndexedList);
app.component('uni-link', UniLink);
app.component('uni-list', UniList);
app.component('uni-list-item', UniListItem);
app.component('uni-load-more', UniLoadMore);
app.component('uni-nav-bar', UniNavBar);
app.component('uni-notice-bar', UniNoticeBar);
app.component('uni-number-box', UniNumberBox);
app.component('uni-pagination', UniPagination);
app.component('uni-popup', UniPopup);
app.component('uni-popup-dialog', UniPopupDialog);
app.component('uni-popup-message', UniPopupMessage);
app.component('uni-popup-share', UniPopupShare);
app.component('uni-rate', UniRate);
app.component('uni-search-bar', UniSearchBar);
app.component('uni-section', UniSection);
app.component('uni-segmented-control', UniSegmentedControl);
app.component('uni-steps', UniSteps);
app.component('uni-swipe-action', UniSwipeAction);
app.component('uni-swipe-action-item', UniSwipeActionItem);
app.component('uni-swiper-dot', UniSwiperDot);
app.component('uni-table', UniTable);
app.component('uni-tag', UniTag);
app.component('uni-transition', UniTransition);

app.component('GlobalBG', GlobalBG);
app.component('SelectPopup', SelectPopup);

// 注册所有 uni-ui 组件
// registerUniUI(app);

// 4. 注册 Pinia 到 Vue 应用
app.use(pinia);
// app.component('uni-icons', uni.Icons)
// 5. 挂载应用
app.mount('#app');
